home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir37 / hdmm46.zip / ZIPLOG.BAT < prev   
DOS Batch File  |  1993-10-15  |  2KB  |  77 lines

  1. ECHO OFF
  2. CLS
  3. REM This program can archive and retrieve any file but was designed for
  4. REM storing HDM.LOG originally.  The programs PKZIP, PKUNZIP, GET, PCOPY,
  5. REM PDEL, and MORE are needed in the DOS path for this program to work.
  6. IF %1. == EXTRACT. GOTO :EXTRACT
  7. IF %1. == . GOTO :HELP
  8. C:
  9. CD\
  10. IF NOT EXIST %1 GOTO :HELP
  11. GET HE 14
  12. DIR %1
  13. ECHO  
  14. GET C "ZIP/Move (-m) %1 to C:\MENU\ZIPLOG.ZIP (Y/N)? " YN /15
  15. IF NOT %GET%. == Y. GOTO :EXIT
  16. GET HE 14
  17. MD %GET%
  18. COPY %1 %GET%
  19. IF EXIST %GET%\*.* PKZIP C:\MENU\ZIPLOG %GET%\*.* -M -P
  20. IF EXIST %GET%\PRN REM RD %GET%
  21. DEL %1
  22. IF NOT %1. == C:\MENU\HDM.LOG GOTO :EXIT
  23. ECHO ~ > \MENU\HDM.LOG
  24. GOTO :EXIT
  25. :HELP
  26. ECHO ZIPLOG.BAT samples and help screen
  27. ECHO ZIPLOG drive:\dir\filename.ext
  28. ECHO ZIPLOG EXTRACT
  29. ECHO  
  30. ECHO This batch file can either place files in HDMZIP.LOG or it can extract
  31. ECHO files from HDMZIP.LOG.  The HDMZIP.LOG file is assumed to be in C:\MENU.
  32. ECHO You must specify a drive:\dir\filename.ext to move to ZIPLOG.ZIP or
  33. ECHO you may view/extract a file by running ZIPLOG EXTRACT.
  34. ECHO  
  35. ECHO To add/move a file this BATCH file uses GET to create a directory
  36. ECHO using the current computer date then moves the filename.ext into that
  37. ECHO directory.  Then PKZIP is called to create or add to ZIPLOG.ZIP moving
  38. ECHO all files from the date\*.* directory. ZIPLOG then removes the directory.
  39. ECHO  
  40. ECHO To view/extract a file ZIPLOG calls PKUNZIP to view the contents of
  41. ECHO ZIPLOG.ZIP using the DOS command MORE.  Then GET is used to take the
  42. ECHO dir\filename.ext to extract (if you want to extract).  Then ZIPLOG
  43. ECHO checks to make sure that directory\filename.ext does not exit. ZIPLOG
  44. ECHO then asks for the destination directory.  It then proceeds to extract
  45. ECHO the file and move it to the desired destination using PCOPY & PDEL.
  46. ECHO  
  47.  
  48. PAUSE
  49. GOTO :EXIT
  50. :EXTRACT
  51. GET Y
  52. SET DIR=GET
  53. IF NOT EXIST \MENU\ZIPLOG.ZIP GOTO :EXIT
  54. PKUNZIP -VB \MENU\ZIPLOG.ZIP | MORE
  55. ECHO  
  56. GET ZE "Extract which dir\filename.ext  (Note: use \  not  /)? "
  57. IF %GET%. == . GOTO :EXIT
  58. SET FILE=%GET%
  59. IF NOT EXIST %FILE% GOTO :PLACE
  60. :EXISTS
  61. GET C "The entry '%FILE%' already exists!  Replace (Y/N)? " YN
  62. IF %GET%. == N. GOTO :EXIT
  63. :PLACE
  64. GET ZE "Place in which directory? "
  65. IF %GET%. == . SET GET=%DIR%
  66. PKUNZIP \MENU\ZIPLOG %FILE% -d -o
  67. IF NOT EXIST %FILE% GOTO :EXIT
  68. IF NOT %FILE%. == %GET%. PCOPY %FILE% %GET% /EQ
  69. PDEL %FILE% /DE /EQ
  70. DIR %GET%
  71. PAUSE
  72. :EXIT
  73. SET GET=
  74. SET FILE=
  75. SET DIR=
  76.  
  77.